package com.ck.daoImpl;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.ck.dao.BanjiDAO;
import com.ck.domain.Banji;

public class BanjiDAOImpl extends SqlMapClientDaoSupport implements BanjiDAO {

	public List<Banji> getAllBanji() {
		return (List<Banji>)getSqlMapClientTemplate().queryForList("getAllBanji");
	}
	
	public Banji getBanjiById(Integer id) {
		return (Banji) getSqlMapClientTemplate().queryForObject("getBanjiById",id);
	}
	
	public Banji getBanjiByName(String name) {
		return (Banji) getSqlMapClientTemplate().queryForObject("getBanjiByName",name);
	}

	public void addNewBanji(Banji banji) {
		getSqlMapClientTemplate().insert("addNewBanji", banji);
	}

	public void updateBanjiInfo(Banji banji) {
		getSqlMapClientTemplate().update("updateBanjiInfo", banji);
	}



	
}
